unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ZAbstractRODataset, ZAbstractDataset, ZDataset, StdCtrls,
  Buttons, DBCtrls;

type
  TForm2 = class(TForm)
    DBLookupComboBox1: TDBLookupComboBox;
    BitBtn1: TBitBtn;
    DataSource1: TDataSource;
    ZQuery1: TZQuery;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses
  Unit1, Unit3;

{$R *.dfm}

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Form1.Close;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
  ZQuery1.SQL.Clear;
  ZQuery1.SQL.Add('select * from tests');
  ZQuery1.Open;
  DBLookupComboBox1.KeyField := 'tname';
end;

procedure TForm2.BitBtn1Click(Sender: TObject);
begin
  if DBLookupComboBox1.Text <> '' then begin
    test_name := DBLookupComboBox1.Text;
    STimer := 0;
    STimer := ZQuery1.FieldValues['ttime'];
    QuestionsCount := 0;
    QuestionsCount := ZQuery1.FieldValues['trate'];
    Application.CreateForm(TForm3, Form3);
    Form3.show;
    Form2.Hide;
  end;
end;

end.
